package com.jrx.anytxn.transaction.dto.payment;

import com.jrx.anytxn.common.constant.RegexConstant;
import com.jrx.anytxn.common.uitl.StringUtils;
import com.jrx.anytxn.param.enums.BizTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 客户还款记录查询请求实体
 * @author  lbz
 **/
@ApiModel(value = "客户还款记录查询", description = "客户还款记录查询")
public class CustRepaymentQueryReq implements Serializable {

    /**
     * 交易流水号
     **/
    @ApiModelProperty(value = "流水号",required = true)
    @Pattern(regexp = RegexConstant.ALL_CHARSET_AND_NUMBER, message = "流水号只能是英文字母和数字组成且不可为空")
    private String seqNo;
    /**
     * 租户ID
     **/
    @ApiModelProperty(value = "租戶id",required = true)
    @Size(max=4, message = "租戶id不能超过4位")
    @NotEmpty(message = "租戶id不可空")
    private String tenantId;
    /**
     * 用户编号
     */
    @Size(max=20, message = "用户编号不能超过20位")
    @ApiModelProperty(value = "用户编号",required = true)
    @NotEmpty(message = "用户编号不能为空")
    private String userId;
    /**
     * 渠道号
     */
    @ApiModelProperty(value = "渠道号", required = true)
    @Size(max=32 , message = "渠道号不能超过32位")
    @NotEmpty(message = "渠道号不能为空")
    private String channel;
    /**
     * 每页条数
     */
    @ApiModelProperty(value = "每页条数", required = true)
    @NotEmpty(message = "每页条数不能为空")
    private String pageSize;
    /**
     * 第几页
     */
    @ApiModelProperty(value = "第几页", required = true)
    @NotEmpty(message = "第几页数不能为空")
    private String pageNum;

    /**
     * 业务类型
     **/
    @ApiModelProperty(value = "业务类型",required = true)
    @Size(max=1, message = "业务类型1--兴安花、2--兴安付、3--信用就医、4--兴安借")
    private String bizType;

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public void checkBizType(){
        if (StringUtils.isBlank(this.bizType)){
            bizType = BizTypeEnum.BIZ_TYPE_XAH.getCode();
        } else {
            BizTypeEnum.getByCodeWhenNullException(this.getBizType());
        }
    }


    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getPageSize() {
        return pageSize;
    }

    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }

    public String getPageNum() {
        return pageNum;
    }

    public void setPageNum(String pageNum) {
        this.pageNum = pageNum;
    }
}
